import os
from pydantic_settings import BaseSettings

class Settings(BaseSettings):
    # MongoDB 配置
    MONGODB_URL: str = "mongodb://test2:4YMsPML8KKyhZmiH@110.42.185.226:27017/test2?authSource=test2"
    MONGODB_DB_NAME: str = "test2"
    
    # Redis 配置（可选，用于缓存或 Session）
    REDIS_HOST: str = "110.42.185.226"
    REDIS_PORT: int = 6379
    REDIS_PASSWORD: str = "7LbALZK4teZIU63AVm9"
    
    # JWT 配置
    SECRET_KEY: str = "your-super-secret-jwt-key-change-in-prod"
    ALGORITHM: str = "HS256"
    ACCESS_TOKEN_EXPIRE_MINUTES: int = 480  # 8小时 = 480分钟
    REFRESH_TOKEN_EXPIRE_DAYS: int = 7
    
    # 默认管理员配置
    DEFAULT_ADMIN_USERNAME: str = "admin"
    DEFAULT_ADMIN_PASSWORD: str = "Aa123123"
    DEFAULT_ADMIN_EMAIL: str = ""  # 管理员允许邮箱为空

    class Config:
        env_file = ".env"

settings = Settings()

